package com.utils;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.model.Staff;

public final class MeiJiaUtils {
	public static String setMessage(String s) {
		String message = "<script type='text/javascript'>alert(" + "'" + s	+ "'" + ")</script>";
		return message;
	}
	
	public static boolean isEmpty(String str) {
		return str == null || "".equals(str);
	}

	public static boolean isNotEmpty(String str) {
		return str != null && !"".equals(str);
	}

	public static <E> boolean isListNotNull(List<E> list){
		return (list != null && list.size() >0) ? true : false;
	}
	
	public static boolean isEquals(String str1, String str2) {
		return str1.equals(str2) ? true : false;
	}
	
	public static boolean isEqualsIgnoreCase(String str1, String str2) {
		return str1.equalsIgnoreCase(str2) ? true : false;
	}
	
	public static Staff getSessionStaff(HttpServletRequest request){
		return (Staff)request.getSession().getAttribute("sessionStaff");
	}
}
